//
//  BCCouponCollectionViewCell.m
//  BangcaiBuy
//
//  Created by Liang Zhang on 16/6/17.
//  Copyright © 2016年 BCB. All rights reserved.
//

#import "BCCouponCollectionViewCell.h"

@implementation BCCouponCollectionViewCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
    _selectedImageView.layer.cornerRadius = _selectedImageView.frame.size.height/2;
    NSString *rmbString = @"100";
    NSMutableAttributedString *couponAttributedString = [[NSMutableAttributedString alloc] initWithString:[NSString stringWithFormat:@"%@元",rmbString]];
    UIFont *rmbTextFont = [UIFont boldSystemFontOfSize:28];
    UIFont *yuanTextFont = [UIFont boldSystemFontOfSize:15];
    [couponAttributedString addAttribute:NSFontAttributeName             //文字字体
                                    value:rmbTextFont
                                    range:NSMakeRange(0, rmbString.length)];
    [couponAttributedString addAttribute:NSFontAttributeName             //文字字体
                                    value:yuanTextFont
                                    range:NSMakeRange(rmbString.length, @"元".length)];
    _rmbLable.attributedText = couponAttributedString;
    if (SCREEN_WIDTH<=320.f) {
        _discription_up_Lable.font = [UIFont systemFontOfSize:7];
        _discription_middle_Lable.font = [UIFont systemFontOfSize:7];
        _discription_down_Lable.font = [UIFont systemFontOfSize:7];
    }
}

+ (instancetype)cellWithCollectionView:(UICollectionView *)collectionView {
    static NSString *ID = @"CouponCell";
    UINib *nib = [UINib nibWithNibName:@"BCCouponCollectionViewCell" bundle: [NSBundle mainBundle]];
    [collectionView registerNib:nib forCellWithReuseIdentifier:ID];
    BCCouponCollectionViewCell *cell = [[BCCouponCollectionViewCell alloc] init];
    return cell;
}

@end
